#include<bits/stdc++.h>
using namespace std;

int maxNum(int a, int b)
{
    for (int i = a > b ? a : b;; i++)
    {
        if (i % a == 0 && i % b == 0)
        {
            return  i;
        }
    }
}
int yueshu(int a, int b)
{
    while (a % b != 0)
    {
        int r = a % b;

        a = b;
        b = r;
    }

    return b;
}
int main()
{
    int n;
    cin >> n;
    vector<int> fenzi;
    vector<int> fenmu;
    getchar();
    string nums;
    getline(cin, nums);
    for (int i = 0; i < nums.size(); i++)
    {
        int j = i;
        while (j != nums.size() - 1 && nums[j] != '/')
        {
            j++;
        }
        int up = stoi(nums.substr(i, j - i));
        fenzi.push_back(up);

        i = j + 1;
        while (i != nums.size() - 1 && nums[i] != ' ')
        {
            i++;
        }
        int down = 0;
        if (i == nums.size() - 1)
        {
            down = stoi(nums.substr(j + 1, i -j));
        }
        else
        {
            down = stoi(nums.substr(j + 1, i - j - 1));
        }
        fenmu.push_back(down);
    }
    int pre = fenmu[0];
    for (int i = 1; i < fenmu.size(); i++)
    {
        pre = maxNum(pre, fenmu[i]);
    }

    int sum = 0;
    for (int i = 0; i < n; i++)
    {
        sum += fenzi[i] * (pre / fenmu[i]);
    }
    int a = sum / pre;
    sum %= pre;
    int b = yueshu(sum, pre);
    sum /= b;
    pre /= b;

    if (a != 0)
    {
        cout << a << " ";
    }
    cout << sum << "/" << pre << endl;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    return 0;
}